package zh.javadesign.工厂方法.impl02;

import zh.javadesign.工厂方法.impl02.store.CardCommodityService;
import zh.javadesign.工厂方法.impl02.store.CouponCommondityService;
import zh.javadesign.工厂方法.impl02.store.GoodsCommodityService;
import zh.javadesign.工厂方法.impl02.store.ICommondity;

/**
 * Copyright (C) 广州中和互联网技术有限公司
 *
 * @author 范家微 fanjiawei@borche.cn
 * @date :2021/1/29 11:24
 */
public class StoreFactory {
	/**
	 * 获取哪种发奖服务
	 * @param commondityType 奖品类型
	 * @return
	 */
	public ICommondity getCommodityService(Integer commondityType){
		switch (commondityType){
			case 1: return new CardCommodityService();
			case 2: return new CouponCommondityService();
			case 3: return new GoodsCommodityService();
			default:throw new RuntimeException("不尊在的商品服务类型");
		}
	}
}
